package com.group.controller;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.group.pojo.TbUserRole;
import com.group.service.UserRoleService;

/**
 * 用户角色controller
 * @author caoyanan
 * @time 2017年10月12日下午5:37:48
 */
@Controller
@RequestMapping("/userRole")
public class UserRoleController {

	@Autowired
	private UserRoleService userRoleService;
	
	@RequestMapping("/save.action")
	@ResponseBody
	public Map<String, String> save(HttpServletRequest request, TbUserRole userRole) {
		Map<String, String> map = userRoleService.save(request, userRole);
		return map;
	}
	
	@RequestMapping("/getUserRoles.action")
	@ResponseBody
	public List<TbUserRole> getUserRoles(TbUserRole userRole) {
		List<TbUserRole> list = userRoleService.getUserRoles(userRole);
		return list;
	}
}
